package com.yin.myproject.operator;

/**
 * Created by Eason on 2017/6/12.
 */
public class BitwiseSample {

    /**
     * 输出一个int的二进制数
     *
     * @param num
     */
    private static void printInfo(int num) {
        System.out.println(Integer.toBinaryString(num));
    }

    public void bitwiseSample() {
        int num = -10;
        printInfo(10);
        num = num << 1;
        printInfo(num);
        int num1 = 20;
        num1 = num1 >> 1;
        printInfo(num1);
    }
}
